<?php 

/**
 * 前台用户模型
 */
class UserModel extends Model{
    public $table = 'user';
    
    public $auto = array(
		array('password', 'md5', 'function', 2, 3),
	);
    
    public $validate = array(
		array('username', 'nonull', '用户名不能为空', 2, 3),
		array('username', 'maxlen:20', '用户名不能超过20个字符', 2, 3),
		array('password', 'nonull', '密码不能为空', 2, 3),
		array('password', 'minlen:6', '密码不能少于6个字符', 2, 3),		
	);
    
    public function addData(){
        if (!$this->create()) {
        		return false;
		}
		  
		return $this->add();
    }
 }
 
 
 
 
 
 
 
 
 
 
 


 ?>